package com.raspberry.monitor.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.raspberry.monitor.entity.SensorData;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SensorDataMapper extends BaseMapper<SensorData> {
    @Select("SELECT * FROM sensor_data WHERE data_type=0 ORDER BY post_time DESC")
    List<SensorData> listTempDataByPostTimeDesc();

    @Select("SELECT * FROM sensor_data WHERE data_type=1 ORDER BY post_time DESC")
    List<SensorData> listSmokeDataByPostTimeDesc();
}
